<form name="contractEditProductForm" class="form-horizontal" novalidate style="width:500px;">
    <div class="form-group mt10 clearfix">
        <span class="col-sm-6 control-label">产品名称</span>

        <div class="col-sm-18">
            <input select2 required ng-model="data.application_id" name="application_id" select2-model="ddl2Project"
                   config="ddlConfigProjects" class="form-control" type="text" placeholder="产品名称"/>
            <span role="alert"
                  ng-show="(contractEditProductForm.$submitted || contractEditProductForm.application_id.$touched) && contractEditProductForm.application_id.$error.required"
                  class="error ng-hide c-red lh30">请选择产品名称</span>
        </div>
    </div>
    <div class="form-group mt10 clearfix"
    ng-if="data.application_id=='other'">
        <span class="col-sm-6 control-label">产品明细</span>

        <div class="col-sm-18">
            <input select2 required ng-model="data.other_application_id" name="other_application_id" select2-model="ddl2OtherProject"
                   config="ddlConfigOtherProjects" class="form-control" type="text" placeholder="产品明细"/>
            <span role="alert"
                  ng-show="(contractEditProductForm.$submitted || contractEditProductForm.other_application_id.$touched) && contractEditProductForm.other_application_id.$error.required"
                  class="error ng-hide c-red lh30">请选择产品明细</span>
        </div>
    </div>

    <div class="form-group mt10 clearfix"
         ng-if="(data.authorization_type==0 || data.authorization_type==1) && data.unique_name!='ad'">
        <span class="col-sm-6 control-label">标准单价</span>

        <div class="col-sm-18" ng-if="data.authorization_type==0 && data.application_id!='other'">
            <input type="number" ng-disabled="true" ng-model="data.price" class="form-control" id="inputPrice"
                   placeholder="标准单价">
        </div>
        <div class="col-sm-18" ng-if="data.authorization_type==0 && data.application_id=='other'">
            <input type="number" ng-model="data.price" class="form-control" id="inputPrice"
                   placeholder="标准单价">
        </div>
        <div class="col-sm-18" ng-if="data.authorization_type==1">
            <input select2 ng-model="data.price" required name="price" select2-model="ddl2SMSPrice"
                   config="ddlConfigSMSPrice" class="form-control" type="text" placeholder="标准单价"/>
            <span role="alert"
                  ng-show="(contractEditProductForm.$submitted || contractEditProductForm.price.$touched) && contractEditProductForm.price.$error.required"
                  class="error ng-hide c-red lh30">标准单价不能为空</span>
        </div>
    </div>
    <div class="form-group mt10 clearfix" ng-if="data.authorization_type==0 && data.unique_name!='ad'">
        <span class="col-sm-6 control-label">产品数</span>

        <div class="col-sm-18">
            <input type="number" ng-model="data.authorization_numeric" required number min="1" name="authorization_numeric" class="form-control" id="inputNumber"
                   placeholder="产品数">
            <span role="alert"
                  ng-show="(contractEditProductForm.$submitted || contractEditProductForm.authorization_numeric.$touched) && contractEditProductForm.authorization_numeric.$error.required"
                  class="error ng-hide c-red lh30">产品数不能为空</span>
            <span role="alert"
                  ng-show="(contractEditProductForm.$submitted || contractEditProductForm.authorization_numeric.$touched) && contractEditProductForm.authorization_numeric.$error.number"
                  class="error ng-hide c-red lh30">产品数必须是数值类型</span>
            <span role="alert"
                  ng-show="(contractEditProductForm.$submitted || contractEditProductForm.authorization_numeric.$touched) && contractEditProductForm.authorization_numeric.$error.min"
                  class="error ng-hide c-red lh30">产品数必须大于0</span>
        </div>
    </div>

    <div class="form-group mt10 clearfix" ng-if="data.authorization_type==0 && data.unique_name!='ad'">
        <span class="col-sm-6 control-label">租用周期(月)</span>

        <div class="col-sm-18">
            <input type="number" ng-model="data.rent_period" required number min="1" name="rent_period" class="form-control" id="inputPeriod"
                   placeholder="租用周期(月)">
            <span role="alert"
                  ng-show="(contractEditProductForm.$submitted || contractEditProductForm.rent_period.$touched) && contractEditProductForm.rent_period.$error.required"
                  class="error ng-hide c-red lh30">租用周期不能为空</span>
            <span role="alert"
                  ng-show="(contractEditProductForm.$submitted || contractEditProductForm.rent_period.$touched) && contractEditProductForm.rent_period.$error.number"
                  class="error ng-hide c-red lh30">租用周期必须是数值类型</span>
            <span role="alert"
                  ng-show="(contractEditProductForm.$submitted || contractEditProductForm.rent_period.$touched) && contractEditProductForm.rent_period.$error.min"
                  class="error ng-hide c-red lh30">租用周期必须大于0</span>

        </div>
    </div>
    <div class="form-group mt10 clearfix" ng-if="data.authorization_type==1">
        <span class="col-sm-6 control-label">短信条数</span>

        <div class="col-sm-18">
            <input type="number" ng-model="data.authorization_numeric" required number min="1" name="authorization_numeric" class="form-control"
                   id="inputSmsNumber" placeholder="短信条数">
            <span role="alert"
                  ng-show="(contractEditProductForm.$submitted || contractEditProductForm.authorization_numeric.$touched) && contractEditProductForm.authorization_numeric.$error.required"
                  class="error ng-hide c-red lh30">短信条数不能为空</span>
            <span role="alert"
                  ng-show="(contractEditProductForm.$submitted || contractEditProductForm.authorization_numeric.$touched) && contractEditProductForm.authorization_numeric.$error.number"
                  class="error ng-hide c-red lh30">短信条数必须是数值类型</span>
            <span role="alert"
                  ng-show="(contractEditProductForm.$submitted || contractEditProductForm.authorization_numeric.$touched) && contractEditProductForm.authorization_numeric.$error.min"
                  class="error ng-hide c-red lh30">短信条数必须大于0</span>
        </div>
    </div>
    <div class="form-group mt10 clearfix" ng-if="data.authorization_type==1 || data.authorization_type==0">
        <span class="col-sm-6 control-label">合同属性</span>
        <div class="col-sm-18">
            <input select2 ng-model="data.contract_type" required name="contract_type" select2-model="ddl2ContractType"
                   config="ddlConfigContractType" class="form-control" type="text" placeholder="合同属性"/>
            <span role="alert"
                  ng-show="(contractEditProductForm.$submitted || contractEditProductForm.contract_type.$touched) && contractEditProductForm.contract_type.$error.required"
                  class="error ng-hide c-red lh30">合同属性不能为空</span>
        </div>
    </div>
    <div class="form-group mt10 clearfix">
        <span class="col-sm-6 control-label">标准金额</span>

        <div class="col-sm-18">
            <input type="number" required number min="0" ng-model="data.amount" name="amount" class="form-control" id="inputAmount"
                   ng-disabled="(data.authorization_type==0 || data.price==0) && data.unique_name!='ad'"
                   placeholder="标准金额">

            <span role="alert"
                  ng-show="(contractEditProductForm.$submitted || contractEditProductForm.amount.$touched) && contractEditProductForm.amount.$error.required"
                  class="error ng-hide c-red lh30">标准金额不能为空</span>
            <span role="alert"
                  ng-show=" contractEditProductForm.amount.$error.number"
                  class="error ng-hide c-red lh30">标准金额必须是数值类型</span>
            <span role="alert"
                  ng-show=" contractEditProductForm.amount.$error.min"
                  class="error ng-hide c-red lh30">标准金额必须大于等于0</span>
        </div>
    </div>

</form>
